Dynomotion

Group: DynoMotion Message: 864 From: ca_gray751 Date: 1/10/2011
Subject: Slaved Homing
Hello,

I am very new to the dynomotion products and to this forum. For the last few weeks I have been playing with my kflop/kanalog boards as well as the kmotion software. Up til now I have been emailing (or should I say driving crazy) Tom direct and he has been a BIG help.

I have now ran into a pretty big stumbling block. I have a machine with a X (with B slaved), Y and A axes. Below is a snippet of a simple home routine that works ok. In this program I am just homing to the switches and slightly moving inside once they are all found. I am also letting the "B" slave just home along with the "X" master.

Jog(0,-3000); // start moving x
while (!ReadBit(136)) ; // wait for switch
Jog(0,0); // stop
Zero(0); //zero x

Jog(1,-3000); // start moving y
while (!ReadBit(137)) ; // wait for switch
Jog(1,0); // stop
Zero(1); //zero y

Jog(3,-800); // start moving a
while (!ReadBit(139)) ; // wait for switch
Jog(3,0); // stop
Zero(3); //zero a

Move(0,500); // move x inside
Move(1,500); // move y inside
Move(3,400); // move a inside


Here is where my trouble starts: I would like to incorporate the "B" slave in to the home sequence and pieced together this snippet:

{
int found0,found1;



Jog(0,-1000); // start moving both axis toward switches

Jog(4,-1000);



found0 = found1 = 0;



while (!found0 || !found1)


{
if (ReadBit(136))

{

Jog(0,0.0); // StopMotion

found0=1;

}

if (ReadBit(138))

{

Jog(1,0.0); // StopMotion

found1=1;
}
}
}


Once the master axis tags its home switch it will stop but the slave axis continues and drives past its home switch.


I am very familiar with Mach3 and vbscripts but haven't a clue about C programming. Any help would be very much appreciated.


TIA,
Allen
Group: DynoMotion Message: 867 From: Tom Kerekes Date: 1/10/2011
Subject: Re: Slaved Homing
Hi Allen,
 
I think you have the right idea but are stopping axis 0 and 1 but your slaved axes are 0 and 4. 
 
Try changing:
 
Jog(1,0.0); // StopMotion
to
 
Jog(4,0.0); // StopMotion

TK

Group: DynoMotion Message: 868 From: ca_gray751 Date: 1/10/2011
Subject: Re: Slaved Homing
I have been through that small piece of code a dozen times and never saw that it was calling axis 1 instead of axis 4!!!! Thanks Tom :)


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Allen,
>
> I think you have the right idea but are stopping axis 0 and 1 but your slaved
> axes are 0 and 4. 
>
>
> Try changing:
>
> Jog(1,0.0); // StopMotion
>
> to
>
> Jog(4,0.0); // StopMotion
>
> TK
>
>
>
> ________________________________
> From: ca_gray751 <agray@...>
> To: DynoMotion@yahoogroups.com
> Sent: Mon, January 10, 2011 9:29:02 AM
> Subject: [DynoMotion] Slaved Homing
>
>  
> Hello,
>
> I am very new to the dynomotion products and to this forum. For the last few
> weeks I have been playing with my kflop/kanalog boards as well as the kmotion
> software. Up til now I have been emailing (or should I say driving crazy) Tom
> direct and he has been a BIG help.
>
> I have now ran into a pretty big stumbling block. I have a machine with a X
> (with B slaved), Y and A axes. Below is a snippet of a simple home routine that
> works ok. In this program I am just homing to the switches and slightly moving
> inside once they are all found. I am also letting the "B" slave just home along
> with the "X" master.
>
> Jog(0,-3000); // start moving x
> while (!ReadBit(136)) ; // wait for switch
> Jog(0,0); // stop
> Zero(0); //zero x
>
> Jog(1,-3000); // start moving y
> while (!ReadBit(137)) ; // wait for switch
> Jog(1,0); // stop
> Zero(1); //zero y
>
> Jog(3,-800); // start moving a
> while (!ReadBit(139)) ; // wait for switch
> Jog(3,0); // stop
> Zero(3); //zero a
>
> Move(0,500); // move x inside
> Move(1,500); // move y inside
> Move(3,400); // move a inside
>
> Here is where my trouble starts: I would like to incorporate the "B" slave in to
> the home sequence and pieced together this snippet:
>
> {
> int found0,found1;
>
>
> Jog(0,-1000); // start moving both axis toward switches
>
> Jog(4,-1000);
>
> found0 = found1 = 0;
>
> while (!found0 || !found1)
>
> {
> if (ReadBit(136))
>
> {
>
> Jog(0,0.0); // StopMotion
>
> found0=1;
>
> }
>
> if (ReadBit(138))
>
> {
>
> Jog(1,0.0); // StopMotion
>
> found1=1;
> }
> }
> }
>
> Once the master axis tags its home switch it will stop but the slave axis
> continues and drives past its home switch.
>
> I am very familiar with Mach3 and vbscripts but haven't a clue about C
> programming. Any help would be very much appreciated.
>
> TIA,
> Allen
>